 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VUE入门学习</title>
    <!-- import Vue before Element -->
    <script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
    <!-- import JavaScript -->
    <script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
    <!--引入Axios-->
    <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
</head>
<body>
<div id="app">
    <div>{{info}}</div>
    <button type="button" @click="f1()">测试异步刷新加载页面</button>
    <button type="button" @click="f2()">psot测试()</button>

    <button type="button" @click="f3()">list1</button>

    <button type="button" @click="f4()">list2</button>

    <input type="text">
    <button></button>
</div>
</body>
</html>
<script>
    var v = new Vue({
        el:"#app",
        data :{
            info:"",
            UserAdminVO:[{
                id:"",
                userName:""
            }]
        },
        methods:{
            f1(){
               // 像服务器发送一个请求
               //  http://localhost:8088/h1?info=tom
                axios.get("/h1?info=tom").then(function (rsq) {
                    console.log(rsq)
                    v.info=rsq.data
                })

            },
            f2(){
                // 像服务器发送一个请求
                //  http://localhost:8088/h2  info=tom
               axios.post("http://localhost:8088/h2",{info:"jerry"}).then(
                   function (rep) {
                       console.log(rep)
                       v.info=rep.data.info;
                   }
                )

            },

            f3(){
                // 像服务器发送一个请求
                //  http://localhost:8088/h2  info=tom
                axios.get("http://localhost:8088/list1").then(
                    function (rep) {
                        console.log(rep)
                        console.log(rep.data)
                        v.UserAdminVO=rep.data;
                    }
                )

            },
            f4(){
                // 像服务器发送一个请求
                //  http://localhost:8088/h2  info=tom
                axios.get("http://localhost:8088/list2").then(
                    function (rep) {
                        console.log(rep)
                        console.log(rep.data.data)
                    }
                )

            }
        }
    });
</script>